const redis = require("ioredis");
const { log } = require("./utils");
const { redisConf } = require("./env");

const client = redis.createClient(redisConf);
// const subClient = redis.createClient(redisConf);
// const pubClient = redis.createClient(redisConf);

client.on("error", err => {
	log("[redis-error] " + err, "red");
});

// subClient.on("error", err => {
// 	log("[subClient-error] " + err, "red");
// });

// pubClient.on("error", err => {
// 	log("[subClient-error] " + err, "red");
// });


module.exports = {
	redis: client
};
